<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
	</head>
	<body>
		
		
		
		
		<div id="app">
			
			
			<counter></counter>
			
			
			<button @click="counter1++">计数器{{counter1}} </button>
			
			
				
		</div>
		
		
		
		<script>
			
			//定义全局组件
			Vue.component('counter',{
				template:'<div><button @click="count++">计数器{{count}} </button></div>',
				data(){
					return{
						count:0
					}
				}
			})
			
			
			
			
			 let vm = new Vue({
			
				 el:'#app', //管理那些元素   elemnent
				 
				 //数据
				 data:{
					counter:0,
					counter1:0,
				 }
			 })
					
			
		</script>
		
	</body>
</html>